<%@ page contentType="text/html;charset=GB2312"%>
<%@ page language="java" import="java.util.*,control.database.*" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.text.*"%>
<%response.setHeader("Refresh","8");%>
<%!
int oper_1=0;
int oper_2=0;
String operation1="";
String operation2="";
%>
<%
String ZhpID="11";
//ZhpID=request.getParameter("ZhpID");
String sql="";
String sql2="";
ResultSet rst=null;
%>
<SCRIPT LANGUAGE="javascript">
 window.open ("../test_zhp.jsp?ZhpID=<%=ZhpID%>", "newwindow", "fullscreen = yes,scrollbars =no,menubar =no,status =no,titlebar =no,toolbar=no")

<%  
DataBase db=new DataBase();
sql=" select * from dbo.CQ_Cmn_ZhpDisplay where ZhpID="+ZhpID;
rst=db.executeQuery(sql);
if(rst.next()){
	if(!rst.getString("operation1").equals(operation1)){

	%>
	 window.open ("../test_zhp.jsp?ZhpID=<%=ZhpID%>", "newwindow", "height=768, width=1280, scroll=no ,toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no, fullscreen=1")
	
	<%
	}
		operation1=rst.getString("operation1");
		//operation2=rst.getString("operation2");
	}
rst.close();
db.closeStmt();
db.closeConn();
int SubCenterNo1=Integer.parseInt(operation1.substring(0,2));
int ServiceNo1=Integer.parseInt(operation1.substring(2,operation1.length()));

DataBase db2=new DataBase();
ResultSet rst2=null;
sql2="select SerialCode from CQ_Cmn_History,(select min(SerialCode)m  from CQ_Cmn_History where SubCenterNo="+SubCenterNo1+" and ServiceNo="+ServiceNo1+" and CustomerStatus=1)a where  a.m=SerialCode ";
//System.out.println(sql2);
rst2=db2.executeQuery(sql2);
String SerialCode[];
	SerialCode = new String[1];
int i=0;

while(rst2.next()){
SerialCode[i]=rst2.getString("SerialCode");
}
rst2.close();
db2.closeStmt();
db2.closeConn();
if(SerialCode[0]==null){
	%>
   window.open ("../test_zhp.jsp?ZhpID=<%=ZhpID%>", "newwindow", "height=768, width=1280, scroll=no ,toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no,fullscreen=1")
   
   <%
}

else if((SerialCode[0]!=null)&&(Integer.parseInt(SerialCode[0])!=oper_1)){
		
	%>
   window.open ("../test_zhp.jsp?ZhpID=<%=ZhpID%>", "newwindow", "height=768, width=1280, scroll=no ,toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no,fullscreen=1")
   
   <%
}
if(SerialCode[0]!=null){
oper_1=Integer.parseInt(SerialCode[0]);
}

System.out.println("operation1="+operation1+"    sql SerialCode[i]"+SerialCode[0]+"  ");
%>
</SCRIPT>